package operation;
import java.util.Scanner;
import book.BookList;
import book.Book;


public class FindOperation extends FindBook implements IOperation{
    @Override
    public void word(BookList bookList){
        System.out.println("查找图书!");
        System.out.println("请输入你要查找的图书:");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.nextLine();
        int ret = findBook(bookList, name);
        if(ret != -1){
            System.out.println(bookList.getBook(ret));
        }
        else{
            System.out.println("未找到此书!");
        }

    }
}
/*name.equals(bookList.getBook(i))*/
/*
int size = bookList.getUsedSize();
        for(int i = 0; i < size; i++){
        if(name.equals(bookList.getBook(i).getName())){
        System.out.println("找到了这本书!");
        System.out.println(bookList.getBook(i));
        return;
        }
        }
        System.out.println("没找到这本书!");*/
